import axios from "@/utils/request";

// 获取验证码
export const getCode = (phone) => {
  return axios({
    url: `/user/passport/sendCode/${phone}`,
    method: 'get'
  })
}

// 注册
export const registerFn = (data) => {
  return axios({
    url: `/user/passport/register`,
    method: 'post',
    data
  })
}

// 登录
export const LoginFn = (data) => {
  return axios({
    url: `/user/passport/login`,
    method: 'post',
    data
  })
}

// 获取用户信息
export const getUserInfo = () => {
  return axios({
    url: `/user/passport/auth/getUserInfo`,
    method: 'get'
  })
}

// 退出登录
export const outlogin = () => {
  return axios({
    url: `/user/passport/logout`,
    method: 'get'
  })
}
